﻿using System.Collections.Generic;
using FileManager.Files;
namespace FileManager
{
    public static class ExtensionMethods
    {
        public static IEnumerable<Folder> GetAllFolders(this Folder parent)
        {
            foreach (Folder subFolder in parent.SubFolders)
            {
                yield return subFolder;
                foreach (Folder descendant in subFolder.GetAllFolders())
                {
                    yield return descendant;
                }
            }
        }
    }
}